<template>
  <basic-container>
    <el-row>
      <el-col :span="24">
        <div class="tool-box">
          <el-button type="primary" icon="el-icon-circle-plus-outline" size="small" @click="handleAdd">新建</el-button>
          <el-button type="primary" icon="el-icon-delete" size="small" @click="handleDelete">删除</el-button>
        </div>
      </el-col>
    </el-row>
    <el-row>
      <el-table
        :data="data"
        ref="multipleTable"
        @selection-change="selectionChange"
        style="width: 100%"
      max-height="400">

        <el-table-column
          type="selection"
          width="55">
        </el-table-column>

        <el-table-column
          prop="id"
          label="id"
          width="175">
        </el-table-column>

        <el-table-column
          prop="version"
          label="版本号"
          width="175">
        </el-table-column>

        <el-table-column
          prop="name"
          label="版本名称"
          width="175">
        </el-table-column>

        <el-table-column
          prop="link"
          label="应用下载地址"
          width="175">
        </el-table-column>

        <el-table-column
          prop="forceUpdate"
          label="强制更新 0:不更新，1:更新"
          width="200">
        </el-table-column>

        <el-table-column
          prop="description"
          label="描述"
          width="175">
        </el-table-column>

        <el-table-column
          prop="type"
          label="设备类型"
          width="175">
        </el-table-column>

        <el-table-column
          prop="createUser"
          label="创建人"
          width="175">
        </el-table-column>

        <el-table-column
          prop="createDept"
          label="创建部门"
          width="175">
        </el-table-column>

        <el-table-column
          prop="createTime"
          label="创建时间"
          width="175">
        </el-table-column>

        <el-table-column
          prop="updateUser"
          label="修改人"
          width="175">
        </el-table-column>

        <el-table-column
          prop="updateTime"
          label="修改时间"
          width="175">
        </el-table-column>

        <el-table-column
          prop="status"
          label="状态"
          width="175">
        </el-table-column>

        <!--<el-table-column
          prop="isDeleted"
          label="是否删除"
          width="100">
        </el-table-column>-->

        <el-table-column
          prop="isSilent"
          label="静默更新.0不静默,1静默."
          width="200">
        </el-table-column>

        <el-table-column
          prop="appStatus"
          label="app业务状态"
          width="175">
        </el-table-column>

        <el-table-column
          prop="createOrg"
          label="创建机构"
          width="175">
        </el-table-column>

        <el-table-column
          prop="createUserBusinessId"
          label="创建人业务id"
          width="175">
        </el-table-column>



        <el-table-column label="操作" fixed="right" width="220">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              plain
              @click="handleView(scope.$index, scope.row)">查看
            </el-button>

            <el-button
              size="mini"
              type="primary"
              plain
              @click="handleEdit(scope.$index, scope.row)">编辑
            </el-button>

            <el-button
              size="mini"
              type="primary"
              plain
              @click="rowDel(scope.$index, scope.row)">删除
            </el-button>

          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-row>
      <el-pagination
        background
        :page-sizes="[10, 20, 30, 50]"
        :page-size="10"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="sizeChange"
        @current-change="currentChange"
        :total="page.total">
      </el-pagination>
    </el-row>




    <el-dialog :title="versionTitle" width='600px' :visible.sync="formVisible" @close="resetForm('versionForm')" :append-to-body=true :destroy-on-close="destroyOnClose" >
      <el-form :model="VERSION" :rules="rules" ref="VERSION" :disabled="DISABLED">

        <!--<el-form-item label="id" prop="id" label-width="120px">
          <el-input v-model="VERSION.id" autocomplete="off" :disabled="edit"></el-input>
        </el-form-item>-->

        <el-form-item label="版本号" prop="version" label-width="120px">
          <el-input v-model="VERSION.version" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="版本名称" prop="name" label-width="120px">
          <el-input v-model="VERSION.name" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="应用下载地址" prop="link" label-width="120px" v-if="viewShow">
          <el-input v-model="VERSION.link" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="强制更新" prop="forceUpdate" label-width="120px">
          <el-radio-group v-model="VERSION.forceUpdate">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="设备类型"  prop="type" label-width="120px">
          <el-radio-group v-model="VERSION.type">
            <el-radio label="android">Android</el-radio>
            <el-radio label="ios">iOS</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="创建人" prop="createUser" label-width="120px" v-if="viewShow">
          <el-input v-model="VERSION.createUser" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="创建人部门" prop="createDept" label-width="120px" v-if="viewShow">
          <el-input v-model="VERSION.createDept" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="创建时间" prop="createTime" label-width="120px" v-if="viewShow">
          <el-date-picker v-model="VERSION.createTime"
            type="datetime"
            placeholder="选择日期时间"
            value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" v-if="viewShow">
          </el-date-picker>
        </el-form-item>

        <el-form-item label="更新人" prop="updateUser" label-width="120px" v-if="viewShow">
          <el-input v-model="VERSION.updateUser" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="更新时间" prop="updateTime" label-width="120px" v-if="viewShow">
          <el-date-picker v-model="VERSION.updateTime"
            type="datetime"
            placeholder="选择日期时间"
            value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" v-if="viewShow">
          </el-date-picker>
        </el-form-item>

        <el-form-item label="状态" prop="status" label-width="120px" v-if="viewShow">
          <el-input v-model="VERSION.status" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="是否删除" prop="isDeleted" label-width="120px" v-if="viewShow">
          <el-radio-group v-model="VERSION.isDeleted">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="静默更新" prop="isSilent" label-width="120px">
          <el-radio-group v-model="VERSION.isSilent">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item label="app状态" prop="appStatus" label-width="120px">
          <el-input v-model="VERSION.appStatus" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="创建机构" prop="createOrg" label-width="120px">
          <el-input v-model="VERSION.createOrg" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="创建人业务id" prop="createUserBusinessId" label-width="120px">
          <el-input v-model="VERSION.createUserBusinessId" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="描述" prop="description" label-width="120px">
          <el-input v-model="VERSION.description" autocomplete="off" type="textarea" :rows="5"></el-input>
        </el-form-item>

      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button @click="resetForm" :style="{ display: visibleCancel }">取 消</el-button>
        <el-button type="primary" @click="rowSave" :style="{ display: visiblePublish }">确 定</el-button>
        <el-button type="primary" @click="rowUpdate" :style="{ display: visibleUpdate }">更 新</el-button>
      </div>
    </el-dialog>


  </basic-container>
</template>

<script>
import {getList,add,update,getDetail,remove} from "@/api/system/version";
//import {getList, getDetail, add, update, remove} from "@/api/system/version";
//import {mapGetters} from "vuex";

export default {

  data() {
    return {

      viewShow:"",
      edit:false,
      DISABLED:false,
      destroyOnClose:false,
      visibleCancel:"",
      visiblePublish:"",
      visibleUpdate:'none',
      query: {},
      loading:true,
      formVisible: false,
      // 默认设备
      //radio1:'1',
      //radio2:'1',
      //radio3:'1',
     /* id: '',
      version:'',
      name: '',
      link:'',
      forceUpdate:'',
      description:'',
      type:'',
      createUser:'',
      createDept:'',
      createTime:'',
      updateUser:'',
      updateTime:'',
      status:'',
      isDeleted:'',
      isSilent:'',
      appStatus:'',
      createOrg:'',
      createUserBusinessId:'',*/

      // vesion标题
      versionTitle: '',

      // 列表数据
      data: [],
      // 选中的数据
      selectionList: [],
      // 分页数据
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
        table:[],
      },
      // 校验规则
      rules: {
        //id: [
          //{required: true, message: '请输入id', trigger: 'blur'},
        //],
        version: [
          {required: true, message: '请输入版本号', trigger: 'blur'},
          {len: 5, message: '长度 5 个字符', trigger: 'blur'},
          {
            required: true,
            pattern: /(^\d{5}$)/,
            message: '请输入正确的版本号,要求5位数字',
            trigger: ['blur','change']
          },
        ],
        name: [
          {required: true, message: '请输入版本名称', trigger: 'blur'},
          {
            required: true,
            pattern: /^甘棠政务[0-9]+\.[0-9]+\.[0-9]+$/,
            message: '要求格式：甘棠政务xx.xx.xx',
            trigger: ['blur','change']
          },
        ],
        type:[
         {required: true, message: '请选择设备',trigger: 'change'},
        ],
        /*link: [
          {required: true, message: '请输入下载地址', trigger: 'blur'},
        ],*/
        forceUpdate:[
          {required: true, message: '请选择是否强制更新',trigger: 'change'},
        ],
        /*createUser:[
          {required: true, message: '请输入创建人',trigger: 'blur'},
        ],
        createDept:[
          {required: true, message: '请输入创建人部门',trigger: 'blur'},
        ],
        createTime:[
          {required: true, message: '请选择创建时间',trigger: 'blur'},
        ],
        updateUser:[
          {required: true, message: '请输入更新人',trigger: 'blur'},
        ],
        updateTime:[
          {required: true, message: '请选择更新时间',trigger: 'blur'},
        ],
        status:[
          {required: true, message: '请输入状态',trigger: 'blur'},
        ],
        //isDeleted:[
          //{required: true, message: '请选择是否删除',trigger: 'change'},
        //],*/
        isSilent:[
          {required: true, message: '请选择是否静默更新',trigger: 'change'},
        ],
        appStatus:[
          {required: true, message: '请输入app状态',trigger: 'blur'},
          {
            required: true,
            pattern: /^[0-1]$/,
            message: '请输入0或1',
            trigger: ['blur','change']
          },
        ],
        createOrg:[
          {required: true, message: '请输入创建机构',trigger: 'blur'},
          {
            required: true,
            pattern: /^[0-9]+$/,
            message: '请输入数字编号',
            trigger: ['blur','change']
          },
        ],
        createUserBusinessId:[
          {required: true, message: '请输入创建人业务id',trigger: 'blur'},
          {
            required: true,
            pattern: /^[0-9]+$/,
            message: '请输入数字编号',
            trigger: ['blur','change']
          },
        ],
        description:[
          {required: true, message: '请输入内容描述',trigger: 'blur'},
          {required: true ,max:5,message: '输入100个字符以内',trigger: ['blur','change']}
        ],
      },
      // 表单映射模型
      /*VERSION: {
        id: '',
        version:'',
        name: '',
        link:'',
        forceUpdate:'',
        description:'',
        type:'',
        createUser:'',
        createDept:'',
        createTime:'',
        updateUser:'',
        updateTime:'',
        status:'',
        isDeleted:'',
        isSilent:'',
        appStatus:'',
        createOrg:'',
        createUserBusinessId:'',
      }*/
      VERSION:{}
    }
  },
  created() {
    this.onLoad();
  },

  computed: {
    ids() {
      let ids = [];
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
    },

  },
  methods: {
    onLoad(page, params = {}) {
      console.log(new Date());
      const {currentPage,pageSize}=this.page;
      this.loading = true;
      getList(currentPage, pageSize, Object.assign(params, this.query)).then(res => {
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        //this.selectionClear();
      });
    },
   /*onLoad() {
      getList().then(res => {
        this.data = res.data.data.records;
        this.page.total = res.data.data.total;
      })
    },*/
    handleAdd() {
      this.versionTitle = '版本发布配置';
      this.DISABLED=false;
      this.viewShow=false;
      this.formVisible = true;
      this.visiblePublish="",
      this.visibleCancel="",
      this.visibleUpdate='none',
      this.edit=false;
      console.log("add")
    },

    rowSave() {
      console.log(this.VERSION.createTime);

      this.$refs["VERSION"].validate((valid) => {
        if (valid) {

      add(this.VERSION).then(res => {
        if(res.data.success) {
          this.formVisible=false;
          this.destroyOnClose=true;
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        }
        else{
          window.console.log("error");
        }
        this.VERSION={};
        //this.$refs.VERSION.resetFields();
      },)}})},

    resetForm(){
      this.formVisible = false;
      this.destroyOnClose=true;
      //this.$refs.VERSION.resetFields();
      this.VERSION={};
    },


    handleView(index,row) {
      //console.log(index);
      //console.log(row);
      this.formVisible=true;
      this.DISABLED=true;
      this.viewShow=true;
      this.visiblePublish='none',
      this.visibleCancel='none',
      this.visibleUpdate='none',
      getDetail(row.id).then(res => {
        this.VERSION = res.data.data;

        //console.log("view");
      })
    },


    handleEdit(index, row) {
      getDetail(row.id).then(res => {
        this.formVisible=true;
        this.DISABLED=false;
        this.viewShow=false;
        this.visiblePublish='none',
        this.visibleCancel='',
        this.visibleUpdate='',
        this.VERSION = res.data.data;
        this.edit=true;
      })
    },



    rowUpdate(){

      this.$refs["VERSION"].validate((valid) => {
        if (valid) {

      update(this.VERSION).then(res =>{
        console.log(res);
        if(res.data.success) {
          this.formVisible=false;
          this.destroyOnClose=true;
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        }
        else{
          window.console.log("error");
        }
      })}})
    },

    rowDel(index, row) {

      remove(row.id).then(res =>{
        if(res.data.success) {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
        }
        else{
          window.console.log("error");
        }
      })

    },

    handleDelete() {
      if (this.selectionList.length === 0) {
        this.$message.warning("请选择至少一条数据");
        return;
      }
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          //this.$refs.multipleTable.toggleSelection();
        });
    },

    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
      done();
    },

    toggleSelection(rows) {
      if (rows) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },

    selectionChange(list) {
      this.selectionList = list;
    },
    /*selectionClear() {
      this.selectionList = [];
      this.$refs.multipleTable.toggleSelection();
    },*/
    currentChange:function(currentPage){
      this.page.currentPage = currentPage;
      this.onLoad();
    },
    sizeChange:function (pageSize){
      this.page.pageSize = pageSize;
      this.onLoad();
    },
    refreshChange() {
      this.onLoad(this.page, this.query);
    },

    /*dateformat(){
      let date=new Date();
      let datastr=date.getFullYear()+"-"+date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
      return datastr;
},

    // handleMultiDelete() {
    //   console.log("multi-delete")
    // },
   /* submitBlog(formName) {
      // 表单验证
      this.$refs[formName].validate((valid) => {
        if (valid) {
          console.log(this.version);
          add(this.version).then(res => {
            if (res.data.success) {
              this.formVisible = false;
              this.$message({
                type: 'success',
                message: '操作成功！'
              })
            } else {
              this.$message({
                type: 'error',
                message: res.data.msg
              })
            }
          })
        }
      })
    },*/
  }
}

</script>
<style lang="scss" scoped>
.el-pagination {
  margin-top: 20px;
}
</style>

<!--<template>
  <basic-container>
    <avue-crud :option="option"
               :table-loading="loading"
               :data="data"
               :page.sync="page"
               :permission="permissionList"
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
               @search-change="searchChange"
               @search-reset="searchReset"
               @selection-change="selectionChange"
               @current-change="currentChange"
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot="menuLeft">
        <el-button type="danger"
                   size="small"
                   icon="el-icon-delete"
                   plain
                   v-if="permission.version_delete"
                   @click="handleDelete">删 除
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>

<script>
  import {getList, getDetail, add, update, remove} from "@/api/system/version";
  import {mapGetters} from "vuex";

  export default {
    data() {
      return {
        form: {},
        query: {},
        loading: true,
        page: {
          pageSize: 10,
          currentPage: 1,
          total: 0
        },
        selectionList: [],
        option: {
          height:'auto',
          calcHeight: 30,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          border: true,
          index: true,
          viewBtn: true,
          selection: true,
          dialogClickModal: false,
          column: [
            {
              label: "id",
              prop: "id",
              rules: [{
                required: true,
                message: "请输入",
                trigger: "blur"
              }]
            },
            {
              label: "版本号",
              prop: "version",
              rules: [{
                required: true,
                message: "请输入版本号",
                trigger: "blur"
              }]
            },
            {
              label: "版本名称",
              prop: "name",
              rules: [{
                required: true,
                message: "请输入版本名称",
                trigger: "blur"
              }]
            },
            {
              label: "应用下载地址",
              prop: "link",
              rules: [{
                required: true,
                message: "请输入应用下载地址",
                trigger: "blur"
              }]
            },
            {
              label: "强制更新 0:不更新，1:更新",
              prop: "forceUpdate",
              rules: [{
                required: true,
                message: "请输入强制更新 0:不更新，1:更新",
                trigger: "blur"
              }]
            },
            {
              label: "描述",
              prop: "description",
              rules: [{
                required: true,
                message: "请输入描述",
                trigger: "blur"
              }]
            },
            {
              label: "设备类型",
              prop: "type",
              rules: [{
                required: true,
                message: "请输入设备类型",
                trigger: "blur"
              }]
            },
            {
              label: "创建人",
              prop: "createUser",
              rules: [{
                required: true,
                message: "请输入创建人",
                trigger: "blur"
              }]
            },
            {
              label: "创建部门",
              prop: "createDept",
              rules: [{
                required: true,
                message: "请输入创建部门",
                trigger: "blur"
              }]
            },
            {
              label: "创建时间",
              prop: "createTime",
              rules: [{
                required: true,
                message: "请输入创建时间",
                trigger: "blur"
              }]
            },
            {
              label: "修改人",
              prop: "updateUser",
              rules: [{
                required: true,
                message: "请输入修改人",
                trigger: "blur"
              }]
            },
            {
              label: "修改时间",
              prop: "updateTime",
              rules: [{
                required: true,
                message: "请输入修改时间",
                trigger: "blur"
              }]
            },
            {
              label: "状态",
              prop: "status",
              rules: [{
                required: true,
                message: "请输入状态",
                trigger: "blur"
              }]
            },
            {
              label: "是否删除",
              prop: "isDeleted",
              rules: [{
                required: true,
                message: "请输入是否删除",
                trigger: "blur"
              }]
            },
            {
              label: "是否静默更新.0不静默,1静默.",
              prop: "isSilent",
              rules: [{
                required: true,
                message: "请输入是否静默更新.0不静默,1静默.",
                trigger: "blur"
              }]
            },
            {
              label: "app的业务状态",
              prop: "appStatus",
              rules: [{
                required: true,
                message: "请输入app的业务状态",
                trigger: "blur"
              }]
            },
            {
              label: "创建机构",
              prop: "createOrg",
              rules: [{
                required: true,
                message: "请输入创建机构",
                trigger: "blur"
              }]
            },
            {
              label: "创建人业务id",
              prop: "createUserBusinessId",
              rules: [{
                required: true,
                message: "请输入创建人业务id",
                trigger: "blur"
              }]
            },
          ]
        },
        data: []
      };
    },
    computed: {
      ...mapGetters(["permission"]),
      permissionList() {
        return {
          addBtn: this.vaildData(this.permission.version_add, true),
          viewBtn: this.vaildData(this.permission.version_view, true),
          delBtn: this.vaildData(this.permission.version_delete, true),
          editBtn: this.vaildData(this.permission.version_edit, true)
        };
      },
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
        });
        return ids.join(",");
      }
    },
    methods: {
      rowSave(row, done, loading) {
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          loading();
          window.console.log(error);
        });
      },
      rowUpdate(row, index, done, loading) {
        update(row).then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!"
          });
          done();
        }, error => {
          loading();
          console.log(error);
        });
      },
      rowDel(row) {
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
          });
      },
      handleDelete() {
        if (this.selectionList.length === 0) {
          this.$message.warning("请选择至少一条数据");
          return;
        }
        this.$confirm("确定将选择数据删除?", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
          })
          .then(() => {
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "操作成功!"
            });
            this.$refs.crud.toggleSelection();
          });
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDetail(this.form.id).then(res => {
            this.form = res.data.data;
          });
        }
        done();
      },
      searchReset() {
        this.query = {};
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
        done();
      },
      selectionChange(list) {
        this.selectionList = list;
      },
      selectionClear() {
        this.selectionList = [];
        this.$refs.crud.toggleSelection();
      },
      currentChange(currentPage){
        this.page.currentPage = currentPage;
      },
      sizeChange(pageSize){
        this.page.pageSize = pageSize;
      },
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      onLoad(page, params = {}) {
        this.loading = true;
        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
        });
      }
    }
  };
</script>

<style>
</style>-->
